/**
 * <copyright>
 * </copyright>
 *

 */
package hu.bme.mit.androtext.gui.androGuiLang.impl;

import hu.bme.mit.androtext.gui.androGuiLang.AndroGuiLangPackage;
import hu.bme.mit.androtext.gui.androGuiLang.PreferenceEntryValuesAttribute;
import hu.bme.mit.androtext.gui.androGuiLang.StringEntry;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Preference Entry Values Attribute</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link hu.bme.mit.androtext.gui.androGuiLang.impl.PreferenceEntryValuesAttributeImpl#getEntryValues <em>Entry Values</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class PreferenceEntryValuesAttributeImpl extends MinimalEObjectImpl.Container implements PreferenceEntryValuesAttribute
{
  /**
   * The cached value of the '{@link #getEntryValues() <em>Entry Values</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getEntryValues()
   * @generated
   * @ordered
   */
  protected StringEntry entryValues;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected PreferenceEntryValuesAttributeImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return AndroGuiLangPackage.Literals.PREFERENCE_ENTRY_VALUES_ATTRIBUTE;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public StringEntry getEntryValues()
  {
    if (entryValues != null && entryValues.eIsProxy())
    {
      InternalEObject oldEntryValues = (InternalEObject)entryValues;
      entryValues = (StringEntry)eResolveProxy(oldEntryValues);
      if (entryValues != oldEntryValues)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, AndroGuiLangPackage.PREFERENCE_ENTRY_VALUES_ATTRIBUTE__ENTRY_VALUES, oldEntryValues, entryValues));
      }
    }
    return entryValues;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public StringEntry basicGetEntryValues()
  {
    return entryValues;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setEntryValues(StringEntry newEntryValues)
  {
    StringEntry oldEntryValues = entryValues;
    entryValues = newEntryValues;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, AndroGuiLangPackage.PREFERENCE_ENTRY_VALUES_ATTRIBUTE__ENTRY_VALUES, oldEntryValues, entryValues));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case AndroGuiLangPackage.PREFERENCE_ENTRY_VALUES_ATTRIBUTE__ENTRY_VALUES:
        if (resolve) return getEntryValues();
        return basicGetEntryValues();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case AndroGuiLangPackage.PREFERENCE_ENTRY_VALUES_ATTRIBUTE__ENTRY_VALUES:
        setEntryValues((StringEntry)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case AndroGuiLangPackage.PREFERENCE_ENTRY_VALUES_ATTRIBUTE__ENTRY_VALUES:
        setEntryValues((StringEntry)null);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case AndroGuiLangPackage.PREFERENCE_ENTRY_VALUES_ATTRIBUTE__ENTRY_VALUES:
        return entryValues != null;
    }
    return super.eIsSet(featureID);
  }

} //PreferenceEntryValuesAttributeImpl
